Enhance shimmer progress with performance metrics#202
Conversation
Added optional fields for estimated time remaining and items per second in IndexProgress interface. Enhanced createShimmerProgress function to calculate and pass performance metrics.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR enhances shimmer indexing progress reporting by adding performance metrics (throughput and ETA) to the progress payload.
Changes:
- Extend
IndexProgresswith optionalestimatedTimeRemainingMsanditemsPerSecond. - Track phase start time and compute metrics on each progress update.
- Post an enriched progress update message to the worker.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| async stop() { | ||
| await worker.terminate(); | ||
| } | ||
| }; | ||
| } | ||
| lastPhase = progress.phase; | ||
|
|
||
| let percent = -1; |
| worker.postMessage({ | ||
| type: 'progress-update', | ||
| phaseName, | ||
| ...enrichedProgress | ||
| }); |
|
|
||
| export function createShimmerProgress(): ShimmerProgress { | ||
| let lastPhase = ''; | ||
| let phaseStartTime = Date.now(); |
| lastPhase = progress.phase; | ||
|
|
||
| // New Feature: Calculate performance metrics | ||
| const elapsedMs = Date.now() - phaseStartTime; |
|
Thanks for the idea, @krataratha — surfacing ETA and items/sec during indexing is a nice touch. Unfortunately this PR can't be merged as-is:
The salvageable part is just the two optional fields on Closing as not-mergeable — but the feature idea is welcome if you'd like to take another run at it. 🙏 |
Added optional fields for estimated time remaining and items per second in IndexProgress interface. Enhanced createShimmerProgress function to calculate and pass performance metrics.